Skip to content

crypto: repair one-time keys when server has more than the account can store - #633

Merged
iFixRobots merged 1 commit into
mainfrom
iFixRobots/repair-excess-otks
Oct 22, 2026
Merged

iFixRobots merged 1 commit into
mainfrom
iFixRobots/repair-excess-otks

Conversation

@iFixRobots

Copy link
Copy Markdown
Contributor

If the server reports more signed one-time keys than MaxNumberOfOneTimeKeys, some of them were already dropped from the account, and since they're claimed oldest-first, every new Olm session to the device fails until they're used up. ShareKeys now runs RepairOneTimeKeys in the background once when the fetched count is above the max.

View in Indent
Tag @indent to continue the conversation here.

@Fizzadar
Fizzadar requested a review from tulir October 20, 2026 20:27
@tulir

tulir commented Oct 20, 2026

Copy link
Copy Markdown
Member

The repair method wasn't really meant for that, but I guess it should work. However, the client is already fairly careful about OTK uploads, so I'd prefer figuring out how it happened and preventing that over working around it

@tulir tulir left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, it was a server bug. This is fine as a temporary thing then. I'll probably remove RepairOneTimeKeys at some point, but it can stay there for a month or two at least

@iFixRobots
iFixRobots merged commit e590628 into main Oct 22, 2026
10 checks passed
@iFixRobots
iFixRobots deleted the iFixRobots/repair-excess-otks branch October 22, 2026 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants